package org.jeecg.modules.door.job;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.door.entity.LwgyJointDoor;
import org.jeecg.modules.door.service.ILwgyJointDoorService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * TODO
 *
 * @author sn
 * @date 2023-08-18 15:20
 *门锁开关控制
 */
@Slf4j
public class SysnLockControlJob implements Job {


    @Autowired
    private ILwgyJointDoorService lwgyJointDoorService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //获取有效的未同步的密码信息
        QueryWrapper<LwgyJointDoor> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sysn",'0');//1是同步0是不同步
        List<LwgyJointDoor> list= lwgyJointDoorService.list(queryWrapper);
        if(oConvertUtils.isNotEmpty(list) && list.size()>0){



            //成功后修改状态
        }


        //往第三方推送
    }
}
